package beans;

import ourImage.OurPlanarImage;
import ourfilter.DilateFilter;
import pimpmypipe.interfaces.Readable;



/**
 *
 * @author Meraner Marcel
 */
public class DilateFilterBean extends FilterBaseBean<DilateFilter> {

    private int _matrixSize = 9;
    private boolean _filterEnabled = false;
    private float _matrixValue = 1.0f;
    
    
    public int getMatrixSize() {
        return _matrixSize;
    }

    public void setMatrixSize(int matrixSize) {
        if (_matrixSize != matrixSize) {
            _matrixSize = matrixSize;
            filteringAndNotify();
        }
    }
    
    
    public float getMatrixValue() {
        return _matrixValue;
    }

    public void setMatrixValue(float matrixValue) {
        if (matrixValue != _matrixValue) {
            _matrixValue = matrixValue;
            filteringAndNotify();
        }
    }
    
    
    @Override
    public boolean isFilterEnabled() {
        return _filterEnabled;
    }

    public void setFilterEnabled(boolean enabled) {
        if (enabled != _filterEnabled) {
            _filterEnabled = enabled;
            filteringAndNotify();
        }
    }
    
    @Override
    protected DilateFilter getConcreteFilter(Readable<OurPlanarImage> in) {
        return new DilateFilter(in, this);
    }

    @Override
    protected DilateFilter configureConcreteFilter(DilateFilter filter) {
        filter.setMatrixSize(_matrixSize);
        filter.setFilterEnabled(_filterEnabled); 
        filter.setMatrixValue(_matrixValue);
        return filter;
    }
    
    
    @Override
    public String getFilterName() {
        return "Dilate Filter";
    }

}
